<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="theme-color" content="#000000">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <link rel="shortcut icon" href="./favicon.ico">
    <link rel="stylesheet" href="__PUBLIC__/apps/css/reset.css">
    <link rel="stylesheet" href="__PUBLIC__/apps/css/index.css">
    <script src="__PUBLIC__/apps/js/jquery-3.1.1.min.js"></script>
    <title>　金蚂蚁装修网</title>

    <script>!function (e, t) { function i() { var t = r.getBoundingClientRect().width; (function () { for (var e = navigator.userAgent, t = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"), i = !0, a = 0; a < t.length; a++)if (e.indexOf(t[a]) > 0) { i = !1; break } return i })() && t < 2047 && (t = t > 540 ? 540 : t); var i = t / 7.5; r.style.fontSize = i + "px", s.rem = e.rem = i } var a, n = e.document, r = n.documentElement, o = n.querySelector('meta[name="viewport"]'), d = n.querySelector('meta[name="flexible"]'), l = 0, m = 0, s = t.flexible || (t.flexible = {}); if (o) { console.warn("将根据已有的meta标签来设置缩放比例"); var p = o.getAttribute("content").match(/initial\-scale=([\d\.]+)/); p && (m = parseFloat(p[1]), l = parseInt(1 / m)) } else if (d) { var c = d.getAttribute("content"); if (c) { var u = c.match(/initial\-dpr=([\d\.]+)/), f = c.match(/maximum\-dpr=([\d\.]+)/); u && (l = parseFloat(u[1]), m = parseFloat((1 / l).toFixed(2))), f && (l = parseFloat(f[1]), m = parseFloat((1 / l).toFixed(2))) } } if (!l && !m) { e.navigator.appVersion.match(/android/gi); var v = e.navigator.appVersion.match(/iphone/gi), h = (e.navigator.appVersion.match(/ipad/gi), e.devicePixelRatio); m = 1 / (l = v ? h >= 3 && (!l || l >= 3) ? 3 : h >= 2 && (!l || l >= 2) ? 2 : 1 : 1) } if (r.setAttribute("data-dpr", l), !o) if ((o = n.createElement("meta")).setAttribute("name", "viewport"), o.setAttribute("content", "initial-scale=" + m + ", maximum-scale=" + m + ", minimum-scale=" + m + ", user-scalable=no"), r.firstElementChild) r.firstElementChild.appendChild(o); else { var g = n.createElement("div"); g.appendChild(o), n.write(g.innerHTML) } e.addEventListener("resize", function () { clearTimeout(a), a = setTimeout(i, 300) }, !1), e.addEventListener("pageshow", function (e) { e.persisted && (clearTimeout(a), a = setTimeout(i, 300)) }, !1), "complete" === n.readyState ? n.body.style.fontSize = 14 * l + "px" : n.addEventListener("DOMContentLoaded", function (e) { n.body.style.fontSize = 14 * l + "px" }, !1), i(), s.dpr = e.dpr = l, s.refreshRem = i, s.rem2px = function (e) { var t = parseFloat(e) * this.rem; return "string" == typeof e && e.match(/rem$/) && (t += "px"), t }, s.px2rem = function (e) { var t = parseFloat(e) / this.rem; return "string" == typeof e && e.match(/px$/) && (t += "rem"), t } }(window, window.lib || (window.lib = {}))


    </script>

</head>

<body>

                <div class="Yuyue">
                    <div class="nav">
                        <a href="{:U('Index/index')}"> <首页</a>
                        <p>{$tit.name}</p>
                    </div>
                    <div class="slider">
                  
                    </div>
                    <div class="title"></div>
                    <div class="bottom">
                        <div class="text">
                            <input type="text" placeholder="请输入您的姓名" class="name" id="name">
                        </div>
                        
                        <div class="text">
                            <input type="text" placeholder="请输入您的手机号" class="phone" id="mobile">
                        </div>
                        <div class="sms">
                            <input type="num" placeholder="请输入验证码" class="code" id="number">
                            <input type='button' id="code" value='获取验证码' onclick="sendMessageDl()">
                        </div>
                        <button class="button">立即预约</button>
                    </div>
                <footer>
                
                </footer>
                </div>


</body>
<script>
    var InterValObj1; //timer变量，控制时间
    var count = 60; //间隔函数，1秒执行
    var curCount;//当前剩余秒数

    function sendMessageDl() {
    
        curCount = count;
        //向后台发送处理数据
        var name=$("#name").val()
        var mobile=$("#mobile").val()
        var code=$("#number").val()

        $.ajax({
            type: "POST", //用POST方式传输
            dataType: "json",
            url: "{:U('Mobile/Sheji/sendsms')}", //目标地址
            data: { 
                name:name,
                mobile:mobile,
                code:code
             },
            success: function (data) {
                // console.log(data)
        $("#code").attr("disabled", "true");
        $("#code").val(  curCount + "秒后重发");
        InterValObj = window.setInterval(SetRemainTimeT, 1000); //启动计时器，1秒执行一次

            }
        });


    }
    function SetRemainTimeT() {
        if (curCount == 0) {
            window.clearInterval(InterValObj);//停止计时器
            $("#code").removeAttr("disabled");//启用按钮
            $("#code").val("重新发送验证码");
        }
        else {
            curCount--;
            $("#code").val(curCount + "秒后重发");
        }
    }
</script>
</html>